<template>
  <div id="app">
    <img src="./assets/logo.png">
    <router-view></router-view>
    <div>{{msg}}</div>
    <div>{{imgSrc}}</div>
    <img :src="imgSrc" style="width: 100%;">
    <button type="button" class="mui-btn" @click="onPlus">默认657567</button>
  </div>
</template>

<script>
  import mui from 'mui' // use mui
  // 设备接口使用
  // import plus from 'plus' // use plus ios支持方式
  // app所有支持方式window.plus
  export default {
    name: 'app',
    data () {
      return {
        msg: 'Welcome to Your Hbuildr App',
        imgSrc: ''
      }
    },
    methods: {
      onPlus () {
        const that = this
        const plus = window.plus
        var cmr = plus.camera.getCamera()
        cmr.captureImage((p) => {
          plus.io.resolveLocalFileSystemURL(p, function (entry) {
            that.msg = entry.name // entry.name
            that.imgSrc = entry.fullPath
          }, (e) => {
          })
        }, (e) => {
        }, {
          filename: '_doc/camera/',  
          index: 1
        })
      }
    },
    mounted () {
      mui.plusReady(() => {
        this.onPlus()
      })
    }
  }
</script>

<style>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    width: 100%;
  }
</style>
